<template>
  <div>
    <x-header id="header" :left-options="{backText: ''}">{{goodDetail.title? goodDetail.title + '介绍' :''}}</x-header>
    <div class="main-header">
      <div class="gd-con">
        <div class="gd-head">
          <div class="name">{{goodDetail.title}}</div>
          <div class="labelList">
            <div class="label" v-for="item in goodDetail.label">{{item}}</div>
          </div>
        </div>
        <div class="gd-content">
          <div class="title">产品介绍</div>
          <div class="applyTo">
            <div class="applyTo-title">适用人群：</div>
            <div class="applyTo-content">{{goodDetail.scope}}</div>
          </div>
          <div class="applyTo">
            <div class="applyTo-title">额度范围：</div>
            <div class="applyTo-content">3万-50万，高达月供金额55倍</div>
          </div>
          <div class="vux-1px-b noName"></div>
          <div class="request-title">准入条件</div>
          <div class="request-item" v-for=" (item, index) in goodDetail.content" :key="index">
            <img class="request-item-icon" src="../../../static/img/on.png" />
            <div class="request-item-content">{{item}}</div>
          </div>
        </div>
        <div class="intro">
          <x-button class="intro-button" @click.native="goRecommend">立即推荐</x-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getGoodsDetail } from '@/api/good'
export default {
  name: 'detail',
  data () {
    return {
      goodDetail: '',
      requestList:[
        '申请人工作关系、房产、户籍三者之一须在本地；',
        '放贷发放机构须为银行，还贷方式须为按月期供；',
        '房贷贷款期限>24个月，房贷已正常还款≥1个月；',
        '若房贷已结清，结清时间≤12个月。'
      ]
    }
  },
  methods: {
    goRecommend() {
      this.$router.push('recommend')
    }
  },
  mounted () {
    getGoodsDetail(this.$route.query.id).then( data => {
      if (data.label) data.label = data.label.split('|')
      if (data.content) data.content = data.content.split('|')
      this.goodDetail = data
    })
  }
}
</script>

<style scoped>

</style>
